Integrand size = 33, antiderivative size = 120 \[ \int (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=a^2 A x+\frac {a^2 (4 A+3 B+2 C) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^2 (2 A+3 B+2 C) \tan (c+d x)}{2 d}+\frac {C (a+a \sec (c+d x))^2 \tan (c+d x)}{3 d}+\frac {(3 B+2 C) \left (a^2+a^2 \sec (c+d x)\right ) \tan (c+d x)}{6 d} \]
a^2*A*x+1/2*a^2*(4*A+3*B+2*C)*arctanh(sin(d*x+c))/d+1/2*a^2*(2*A+3*B+2*C)* tan(d*x+c)/d+1/3*C*(a+a*sec(d*x+c))^2*tan(d*x+c)/d+1/6*(3*B+2*C)*(a^2+a^2* sec(d*x+c))*tan(d*x+c)/d
Time = 2.70 (sec) , antiderivative size = 75, normalized size of antiderivative = 0.62 \[ \int (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {a^2 \left (6 A d x+3 (4 A+3 B+2 C) \text {arctanh}(\sin (c+d x))+3 (2 A+4 (B+C)+(B+2 C) \sec (c+d x)) \tan (c+d x)+2 C \tan ^3(c+d x)\right )}{6 d} \]
(a^2*(6*A*d*x + 3*(4*A + 3*B + 2*C)*ArcTanh[Sin[c + d*x]] + 3*(2*A + 4*(B + C) + (B + 2*C)*Sec[c + d*x])*Tan[c + d*x] + 2*C*Tan[c + d*x]^3))/(6*d)
Time = 0.71 (sec) , antiderivative size = 128, normalized size of antiderivative = 1.07, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 4542, 3042, 4405, 27, 3042, 4402, 3042, 4254, 24, 4257}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int (a \sec (c+d x)+a)^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \left (a \csc \left (c+d x+\frac {\pi }{2}\right )+a\right )^2 \left (A+B \csc \left (c+d x+\frac {\pi }{2}\right )+C \csc \left (c+d x+\frac {\pi }{2}\right )^2\right )dx\) |
\(\Big \downarrow \) 4542 |
\(\displaystyle \frac {\int (\sec (c+d x) a+a)^2 (3 a A+a (3 B+2 C) \sec (c+d x))dx}{3 a}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right )^2 \left (3 a A+a (3 B+2 C) \csc \left (c+d x+\frac {\pi }{2}\right )\right )dx}{3 a}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d}\) |
\(\Big \downarrow \) 4405 |
\(\displaystyle \frac {\frac {1}{2} \int 3 (\sec (c+d x) a+a) \left (2 A a^2+(2 A+3 B+2 C) \sec (c+d x) a^2\right )dx+\frac {(3 B+2 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{3 a}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {\frac {3}{2} \int (\sec (c+d x) a+a) \left (2 A a^2+(2 A+3 B+2 C) \sec (c+d x) a^2\right )dx+\frac {(3 B+2 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{3 a}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {3}{2} \int \left (\csc \left (c+d x+\frac {\pi }{2}\right ) a+a\right ) \left (2 A a^2+(2 A+3 B+2 C) \csc \left (c+d x+\frac {\pi }{2}\right ) a^2\right )dx+\frac {(3 B+2 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{3 a}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d}\) |
\(\Big \downarrow \) 4402 |
\(\displaystyle \frac {\frac {3}{2} \left (a^3 (2 A+3 B+2 C) \int \sec ^2(c+d x)dx+a^3 (4 A+3 B+2 C) \int \sec (c+d x)dx+2 a^3 A x\right )+\frac {(3 B+2 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{3 a}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {3}{2} \left (a^3 (4 A+3 B+2 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+a^3 (2 A+3 B+2 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )^2dx+2 a^3 A x\right )+\frac {(3 B+2 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{3 a}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d}\) |
\(\Big \downarrow \) 4254 |
\(\displaystyle \frac {\frac {3}{2} \left (-\frac {a^3 (2 A+3 B+2 C) \int 1d(-\tan (c+d x))}{d}+a^3 (4 A+3 B+2 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+2 a^3 A x\right )+\frac {(3 B+2 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{3 a}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d}\) |
\(\Big \downarrow \) 24 |
\(\displaystyle \frac {\frac {3}{2} \left (a^3 (4 A+3 B+2 C) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+\frac {a^3 (2 A+3 B+2 C) \tan (c+d x)}{d}+2 a^3 A x\right )+\frac {(3 B+2 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{3 a}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d}\) |
\(\Big \downarrow \) 4257 |
\(\displaystyle \frac {\frac {3}{2} \left (\frac {a^3 (4 A+3 B+2 C) \text {arctanh}(\sin (c+d x))}{d}+\frac {a^3 (2 A+3 B+2 C) \tan (c+d x)}{d}+2 a^3 A x\right )+\frac {(3 B+2 C) \tan (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}}{3 a}+\frac {C \tan (c+d x) (a \sec (c+d x)+a)^2}{3 d}\) |
(C*(a + a*Sec[c + d*x])^2*Tan[c + d*x])/(3*d) + (((3*B + 2*C)*(a^3 + a^3*S ec[c + d*x])*Tan[c + d*x])/(2*d) + (3*(2*a^3*A*x + (a^3*(4*A + 3*B + 2*C)* ArcTanh[Sin[c + d*x]])/d + (a^3*(2*A + 3*B + 2*C)*Tan[c + d*x])/d))/2)/(3* a)
3.5.20.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Simp[-d^(-1) Subst[Int[Exp andIntegrand[(1 + x^2)^(n/2 - 1), x], x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))*(csc[(e_.) + (f_.)*(x_)]*(d_.) + (c_)), x_Symbol] :> Simp[a*c*x, x] + (Simp[b*d Int[Csc[e + f*x]^2, x], x ] + Simp[(b*c + a*d) Int[Csc[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, f }, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d _.) + (c_)), x_Symbol] :> Simp[(-b)*d*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m - 1)/(f*m)), x] + Simp[1/m Int[(a + b*Csc[e + f*x])^(m - 1)*Simp[a*c*m + (b*c*m + a*d*(2*m - 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && GtQ[m, 1] && EqQ[a^2 - b^2, 0] && IntegerQ[2 *m]
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. ))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_.), x_Symbol] :> Simp[(-C)*Cot [e + f*x]*((a + b*Csc[e + f*x])^m/(f*(m + 1))), x] + Simp[1/(b*(m + 1)) I nt[(a + b*Csc[e + f*x])^m*Simp[A*b*(m + 1) + (a*C*m + b*B*(m + 1))*Csc[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && EqQ[a^2 - b^2, 0] && !LtQ[m, -2^(-1)]
Time = 0.52 (sec) , antiderivative size = 139, normalized size of antiderivative = 1.16
method | result | size |
parts | \(a^{2} A x +\frac {\left (2 a^{2} A +B \,a^{2}\right ) \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}+\frac {\left (B \,a^{2}+2 C \,a^{2}\right ) \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}+\frac {\left (a^{2} A +2 B \,a^{2}+C \,a^{2}\right ) \tan \left (d x +c \right )}{d}-\frac {C \,a^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )}{d}\) | \(139\) |
parallelrisch | \(\frac {a^{2} \left (-6 \left (A +\frac {3 B}{4}+\frac {C}{2}\right ) \left (\frac {\cos \left (3 d x +3 c \right )}{3}+\cos \left (d x +c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+6 \left (A +\frac {3 B}{4}+\frac {C}{2}\right ) \left (\frac {\cos \left (3 d x +3 c \right )}{3}+\cos \left (d x +c \right )\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+d x A \cos \left (3 d x +3 c \right )+\left (A +2 B +\frac {5 C}{3}\right ) \sin \left (3 d x +3 c \right )+\left (B +2 C \right ) \sin \left (2 d x +2 c \right )+3 d x A \cos \left (d x +c \right )+\sin \left (d x +c \right ) \left (A +2 B +3 C \right )\right )}{d \left (\cos \left (3 d x +3 c \right )+3 \cos \left (d x +c \right )\right )}\) | \(181\) |
derivativedivides | \(\frac {a^{2} A \tan \left (d x +c \right )+B \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-C \,a^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+2 a^{2} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 B \,a^{2} \tan \left (d x +c \right )+2 C \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{2} A \left (d x +c \right )+B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C \,a^{2} \tan \left (d x +c \right )}{d}\) | \(186\) |
default | \(\frac {a^{2} A \tan \left (d x +c \right )+B \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )-C \,a^{2} \left (-\frac {2}{3}-\frac {\sec \left (d x +c \right )^{2}}{3}\right ) \tan \left (d x +c \right )+2 a^{2} A \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+2 B \,a^{2} \tan \left (d x +c \right )+2 C \,a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{2} A \left (d x +c \right )+B \,a^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+C \,a^{2} \tan \left (d x +c \right )}{d}\) | \(186\) |
norman | \(\frac {a^{2} A x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}-a^{2} A x +3 a^{2} A x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-3 a^{2} A x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{4}-\frac {a^{2} \left (2 A +3 B +2 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}-\frac {a^{2} \left (2 A +5 B +6 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {4 a^{2} \left (3 A +6 B +4 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{3 d}}{\left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-1\right )^{3}}-\frac {a^{2} \left (4 A +3 B +2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {a^{2} \left (4 A +3 B +2 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(224\) |
risch | \(a^{2} A x -\frac {i a^{2} \left (3 B \,{\mathrm e}^{5 i \left (d x +c \right )}+6 C \,{\mathrm e}^{5 i \left (d x +c \right )}-6 A \,{\mathrm e}^{4 i \left (d x +c \right )}-12 B \,{\mathrm e}^{4 i \left (d x +c \right )}-6 C \,{\mathrm e}^{4 i \left (d x +c \right )}-12 A \,{\mathrm e}^{2 i \left (d x +c \right )}-24 B \,{\mathrm e}^{2 i \left (d x +c \right )}-24 C \,{\mathrm e}^{2 i \left (d x +c \right )}-3 B \,{\mathrm e}^{i \left (d x +c \right )}-6 C \,{\mathrm e}^{i \left (d x +c \right )}-6 A -12 B -10 C \right )}{3 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{3}}-\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{d}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) B}{2 d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{d}+\frac {2 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{d}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) B}{2 d}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{d}\) | \(291\) |
a^2*A*x+(2*A*a^2+B*a^2)/d*ln(sec(d*x+c)+tan(d*x+c))+(B*a^2+2*C*a^2)/d*(1/2 *sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+c)))+(A*a^2+2*B*a^2+C*a^2 )/d*tan(d*x+c)-C*a^2/d*(-2/3-1/3*sec(d*x+c)^2)*tan(d*x+c)
Time = 0.27 (sec) , antiderivative size = 150, normalized size of antiderivative = 1.25 \[ \int (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {12 \, A a^{2} d x \cos \left (d x + c\right )^{3} + 3 \, {\left (4 \, A + 3 \, B + 2 \, C\right )} a^{2} \cos \left (d x + c\right )^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (4 \, A + 3 \, B + 2 \, C\right )} a^{2} \cos \left (d x + c\right )^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, {\left (3 \, A + 6 \, B + 5 \, C\right )} a^{2} \cos \left (d x + c\right )^{2} + 3 \, {\left (B + 2 \, C\right )} a^{2} \cos \left (d x + c\right ) + 2 \, C a^{2}\right )} \sin \left (d x + c\right )}{12 \, d \cos \left (d x + c\right )^{3}} \]
1/12*(12*A*a^2*d*x*cos(d*x + c)^3 + 3*(4*A + 3*B + 2*C)*a^2*cos(d*x + c)^3 *log(sin(d*x + c) + 1) - 3*(4*A + 3*B + 2*C)*a^2*cos(d*x + c)^3*log(-sin(d *x + c) + 1) + 2*(2*(3*A + 6*B + 5*C)*a^2*cos(d*x + c)^2 + 3*(B + 2*C)*a^2 *cos(d*x + c) + 2*C*a^2)*sin(d*x + c))/(d*cos(d*x + c)^3)
\[ \int (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=a^{2} \left (\int A\, dx + \int 2 A \sec {\left (c + d x \right )}\, dx + \int A \sec ^{2}{\left (c + d x \right )}\, dx + \int B \sec {\left (c + d x \right )}\, dx + \int 2 B \sec ^{2}{\left (c + d x \right )}\, dx + \int B \sec ^{3}{\left (c + d x \right )}\, dx + \int C \sec ^{2}{\left (c + d x \right )}\, dx + \int 2 C \sec ^{3}{\left (c + d x \right )}\, dx + \int C \sec ^{4}{\left (c + d x \right )}\, dx\right ) \]
a**2*(Integral(A, x) + Integral(2*A*sec(c + d*x), x) + Integral(A*sec(c + d*x)**2, x) + Integral(B*sec(c + d*x), x) + Integral(2*B*sec(c + d*x)**2, x) + Integral(B*sec(c + d*x)**3, x) + Integral(C*sec(c + d*x)**2, x) + Int egral(2*C*sec(c + d*x)**3, x) + Integral(C*sec(c + d*x)**4, x))
Time = 0.27 (sec) , antiderivative size = 210, normalized size of antiderivative = 1.75 \[ \int (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {12 \, {\left (d x + c\right )} A a^{2} + 4 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a^{2} - 3 \, B a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 6 \, C a^{2} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 24 \, A a^{2} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 12 \, B a^{2} \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 12 \, A a^{2} \tan \left (d x + c\right ) + 24 \, B a^{2} \tan \left (d x + c\right ) + 12 \, C a^{2} \tan \left (d x + c\right )}{12 \, d} \]
1/12*(12*(d*x + c)*A*a^2 + 4*(tan(d*x + c)^3 + 3*tan(d*x + c))*C*a^2 - 3*B *a^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin(d*x + c) + 1) + log(si n(d*x + c) - 1)) - 6*C*a^2*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(sin( d*x + c) + 1) + log(sin(d*x + c) - 1)) + 24*A*a^2*log(sec(d*x + c) + tan(d *x + c)) + 12*B*a^2*log(sec(d*x + c) + tan(d*x + c)) + 12*A*a^2*tan(d*x + c) + 24*B*a^2*tan(d*x + c) + 12*C*a^2*tan(d*x + c))/d
Leaf count of result is larger than twice the leaf count of optimal. 250 vs. \(2 (112) = 224\).
Time = 0.35 (sec) , antiderivative size = 250, normalized size of antiderivative = 2.08 \[ \int (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {6 \, {\left (d x + c\right )} A a^{2} + 3 \, {\left (4 \, A a^{2} + 3 \, B a^{2} + 2 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (4 \, A a^{2} + 3 \, B a^{2} + 2 \, C a^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (6 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 6 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 16 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 6 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 15 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 18 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{3}}}{6 \, d} \]
1/6*(6*(d*x + c)*A*a^2 + 3*(4*A*a^2 + 3*B*a^2 + 2*C*a^2)*log(abs(tan(1/2*d *x + 1/2*c) + 1)) - 3*(4*A*a^2 + 3*B*a^2 + 2*C*a^2)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(6*A*a^2*tan(1/2*d*x + 1/2*c)^5 + 9*B*a^2*tan(1/2*d*x + 1 /2*c)^5 + 6*C*a^2*tan(1/2*d*x + 1/2*c)^5 - 12*A*a^2*tan(1/2*d*x + 1/2*c)^3 - 24*B*a^2*tan(1/2*d*x + 1/2*c)^3 - 16*C*a^2*tan(1/2*d*x + 1/2*c)^3 + 6*A *a^2*tan(1/2*d*x + 1/2*c) + 15*B*a^2*tan(1/2*d*x + 1/2*c) + 18*C*a^2*tan(1 /2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^3)/d
Time = 17.04 (sec) , antiderivative size = 421, normalized size of antiderivative = 3.51 \[ \int (a+a \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx=\frac {\frac {A\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{4}+\frac {B\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{4}+\frac {B\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{2}+\frac {C\,a^2\,\sin \left (2\,c+2\,d\,x\right )}{2}+\frac {5\,C\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{12}+\frac {A\,a^2\,\sin \left (c+d\,x\right )}{4}+\frac {B\,a^2\,\sin \left (c+d\,x\right )}{2}+\frac {3\,C\,a^2\,\sin \left (c+d\,x\right )}{4}+\frac {3\,A\,a^2\,\cos \left (c+d\,x\right )\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+3\,A\,a^2\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )+\frac {9\,B\,a^2\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4}+\frac {3\,C\,a^2\,\cos \left (c+d\,x\right )\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {A\,a^2\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}+A\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )+\frac {3\,B\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{4}+\frac {C\,a^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (3\,c+3\,d\,x\right )}{2}}{d\,\left (\frac {3\,\cos \left (c+d\,x\right )}{4}+\frac {\cos \left (3\,c+3\,d\,x\right )}{4}\right )} \]
((A*a^2*sin(3*c + 3*d*x))/4 + (B*a^2*sin(2*c + 2*d*x))/4 + (B*a^2*sin(3*c + 3*d*x))/2 + (C*a^2*sin(2*c + 2*d*x))/2 + (5*C*a^2*sin(3*c + 3*d*x))/12 + (A*a^2*sin(c + d*x))/4 + (B*a^2*sin(c + d*x))/2 + (3*C*a^2*sin(c + d*x))/ 4 + (3*A*a^2*cos(c + d*x)*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/2 + 3*A*a^2*cos(c + d*x)*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)) + (9*B* a^2*cos(c + d*x)*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/4 + (3*C*a^ 2*cos(c + d*x)*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/2 + (A*a^2*at an(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(3*c + 3*d*x))/2 + A*a^2*atan h(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(3*c + 3*d*x) + (3*B*a^2*atanh (sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(3*c + 3*d*x))/4 + (C*a^2*atanh (sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(3*c + 3*d*x))/2)/(d*((3*cos(c + d*x))/4 + cos(3*c + 3*d*x)/4))